<template>
  <div>
    login
    {{ token }}
    <button @click="click">sssss</button>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useCounterStore } from "@/current";
import { storeToRefs } from "pinia"; 

// cnpm i pinia --save  2.1.3
const counter = useCounterStore();
const { token } = storeToRefs(counter); //  数据
// const { token } = store; //方法

const click = ()=>{
  token.value = "111"; 
}
onMounted(() => {
 
});

</script>

<style scoped lang="scss">
.a {
  .b {
  }
}
</style> 